export interface DownloadSetting {
  downloadSettings?: {
    url: string;
    type: string[];
  }[];
  version: string;
  pluginVersion: string;
}

const meta: DownloadSetting = {
  version: "0",
  pluginVersion: "1.0.0",
};

export function init() {
  return fetch(`${PUBLIC_URL}meta.json?_=${Date.now()}`)
    .then((res) => res.json())
    .then((data) => {
      Object.assign(meta, data);
      chrome.storage.sync.set({
        siteVersion: meta.version,
      });
      return data;
    });
}

export default meta;
